// 导入express
const express = require('express');
// 实例化路由对象
const router = express.Router();
// 导入处理函数模块
const { register,login } = require('../routerHandler/userHandler');

// 导入验证模块
const expressJoi = require('@escook/express-joi');
// 导入验证规则
const { registerSchema, loginSchema } = require('../schema/userSchema');

// 注册
router.post('register', expressJoi(registerSchema), register)
// 登录
router.post('/login', expressJoi(loginSchema), login)

// 导出用户路由模块
module.exports = router;